package com.dorukdestan.p2pshare.utiltest;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.CRC32;

public class MyFile extends CRC32{

	public MyFile(String path) {
		
		File file = new File(path);
		
		try {
			InputStream is =  new FileInputStream(file);
			byte []byteArray = new byte[(int)file.length()];
			
			is.read(byteArray);
			
			/**
			 * buradaki hersey bu fonksiyonu[update(byteArray)] myfile sinifinin bir nesnesi
			 * ilk yaratildiginda cagirabilmek icin...
			 */
			update(byteArray);
			
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
